package sch.frog.creational.prototype.model;

public class ObjC implements Cloneable{

    private int c;

    private ObjA objA;

    public int getC() {
        return c;
    }

    public void setC(int c) {
        this.c = c;
    }

    public ObjA getObjA() {
        return objA;
    }

    public void setObjA(ObjA objA) {
        this.objA = objA;
    }

    @Override
    public String toString() {
        return "ObjC{" +
                "c=" + c +
                ", objA=" + objA +
                '}';
    }

    @Override
    public ObjC clone(){
        try {
            ObjC c = (ObjC) super.clone();
            c.setObjA(this.objA.clone());
            return c;
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
            return null;
        }
    }
}
